package com.heima.user.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.LoginDto;
import com.heima.user.service.IApUserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 登录接口表现层
 */
@RestController
@RequestMapping("/api/v1/login")
@Api(value = "登录接口表现层",tags = "登录接口",description = "登录接口")
public class LoginController {

    @Resource
    private IApUserService apUserService;
    /**
     * 登录请求
     * @param dto
     * @return
     */
    @PostMapping("/login_auth")
    @ApiOperation(value = "登录方法")
    public ResponseResult login(@RequestBody LoginDto dto){
        return apUserService.login(dto);
    }
}
